using System;
using System.Collections.ObjectModel;
using System.Windows.Markup;
using Rhizome.Contract;
using Rhizome.Internal;

namespace Rhizome.Model
{
    [ContentProperty("Criterions")]
    public abstract class AggregateCriterionBase<TPlant> : CriterionBase<TPlant>
    {
        protected AggregateCriterionBase(params ICriterion[] criterions)
            : this()
        {
            foreach (var action in criterions)
                Criterions.Add(action);
        }

        protected AggregateCriterionBase()
        {
            Criterions = new RhizomeElementCollection<ICriterion>(this);
        }

        public Collection<ICriterion> Criterions { get; private set; }
    }
}